<template>
  <div>
    <div ref='divpc' class='divpc'>
      <div ref='fasr_div140102' class='fasr_div140102 tr-div-default'>
        <div ref='LayoutGrid140032' class='LayoutGrid140032 row' rowGap='' columnGap='' responsive='pc-mobile-gear'>
          <div ref='LayoutGrid140132'
            class='LayoutGrid140132 row col justify-start items-center col-xs-7 col-sm-9 col-md-8 col-lg-6 col-xl-6 col-7'
            rowGap='' columnGap='8px' responsive='5-gear' justify='justify-start' items='items-center'>

            <t-input ref='fas_txtInput' class='fas_txtInput' :label="'要查询的条件'" borderType='borderless'
              labelPosition='left' :hideLabel='true' :placeholder="'请输入要查询的条件'" bgColor='#ffffff' helpPlacement='bottom'
              :clearable='true' type='text' @keydown='fas_txtInput_OnKeydown' v-model='LocalVars.varInput'>
            </t-input>
            <t-button ref='fasr_btnQuery' class='fasr_btnQuery tr-button-primary' :label="'搜索'"
              icon='fas dx-icon icon-t-zoom ' :showHint='true' @click='fasr_btnQuery_OnClick'>
            </t-button>
            <t-button ref='fas_btnReset' class='fas_btnReset tr-button-default' :label="'重置'"
              icon='fas dx-icon icon-t-reset-fine' :showHint='true' @click='fas_btnReset_OnClick'>
            </t-button>
          </div>
          <div ref='LayoutGrid140134'
            class='LayoutGrid140134 row col justify-end items-center col-xs-5 col-sm-3 col-md-4 col-lg-6 col-xl-6 col-5'
            rowGap='' columnGap='' responsive='5-gear' justify='justify-end' items='items-center'>
            <t-btn-group ref='fas_btnGroup' class='fas_btnGroup' :staticItems='btn_group_static_items' btnSpace='8px'
              :moreMaxCount='5' :moreConf='true' :autoModel='true' @Click_新增='fas_btnGroup_Click_新增'
              @Click_查看='fas_btnGroup_Click_查看' @Click_编辑='fas_btnGroup_Click_编辑' @Click_复制='fas_btnGroup_Click_复制'
              @Click_删除='fas_btnGroup_Click_删除' @Click_订阅数据='fas_btnGroup_Click_订阅数据'
            
              @btnGroupItemClick='(action) => fas_btnGroup_btnGroupItemClick(action, row)'>
            </t-btn-group>
          </div>
        </div>
      </div>
      <div ref='div133915' class='div133915 tr-div-default'>
        <t-filter ref='fasr_filter' style='opacity:100%' class='fasr_filter' :filterService='filter_service'
          :filterScheme='{
            "ElementType": "Group",
            "Filters": []
          }' isShowTopContent='1'
          isShowOperateCellButton='1' showShortcutCondition='' enableQuickFilter='0' isCollapse='1' isShowCollapse='1'
          operatePosition='1' :pageID='PageID' :pageCode='PageCode' :filterFields='LocalVars.fasr_filter_Fields'
          @init='fasr_filter_Init' :quickItems='LocalVars.fasr_filter_QuickItems'>
        </t-filter>
      </div>
      <div ref='div134112' class='div134112 tr-div-default'>
        <t-mixed-view ref='fasr_mixed_view' class='fasr_mixed_view' fillMarginBottom_GridData='0px'
          :allowColumnWarp_GridData='false' :showRowNumber_GridData='true'
          :staticItems_ButtonGroup='mixed_view_btn_group_static_items' btnSpace_ButtonGroup='8px'
          :moreMaxCount_ButtonGroup='5' exportFileName='' 
          :optColumns='mixed_view_opt_columns' rowKey_GridData='ID' selection_GridData='single'
          :rows_GridData='LocalVars.fasr_mixed_view_DataSource' :loading_GridData='LocalVars.fasr_mixed_view_Loading'
          :pageIndex_GridData='LocalVars.fasr_mixed_view_PageIndex'
          :pageSize_GridData='LocalVars.fasr_mixed_view_PageSize' :rowsNumber_GridData='LocalVars.fasr_mixed_view_Total'
          @request_GridData='fasr_mixed_view_Request' :rows_all='LocalVars.fasr_mixed_view_AllDataSource'
          :loading_all='LocalVars.fasr_mixed_view_AllLoading'
          :columnLinkFormat_GridData='fasr_mixed_view_columnLinkFormat'

         >
        </t-mixed-view>
      </div>
    </div>
    <div v-if='!screengreaterxs' ref='divmobile' style='opacity:100%' class='divmobile'>
      <div ref='LayoutGridQuery'
        style='padding-left:16px;    padding-right:16px;    display:flex;    opacity:100%;    align-content: center;    justify-content:;'
        class='LayoutGridQuery tr-form-background row' rowGap='' columnGap='' responsive='pc-mobile-gear'>
        <div ref='LayoutGridSearch'
          style='padding-top:4px;    height:40px;    display:flex;    align-items:center;    z-index:100;    opacity:100%;    justify-content:;'
          class='LayoutGridSearch row col col-sm-12 col-xs-12' rowGap='' columnGap='' responsive='pc-mobile-gear'
          items='center'>
          <t-popup-search ref='fasr_popup_search' style='opacity:100%;    flex:1' class='fasr_popup_search'
            :itemTemplateGeneral='popup_search_itemTemplateGeneral' :showSearchBar='true' :placeholder="'搜索'"
            :pageID='PageID' :pageCode='PageCode' :rows='LocalVars.fasr_popup_search_DataSource'
            :totalCount='LocalVars.fasr_popup_search_Total' :loading='LocalVars.fasr_popup_search_loadingBase'
            :finished='LocalVars.fasr_popup_search_finishedBase' :error='LocalVars.fasr_popup_search_Error'
            v-model:refreshing='LocalVars.fasr_popup_search_refreshingBase' @load='fasr_popup_search_getData'
            @refresh='fasr_popup_search_refresh' @clear='fasr_popup_search_clear'
            @clickItem='fasr_popup_search_OnClickItem'>
          </t-popup-search>
          <t-btn-group ref='fasr_btn_more' style='opacity:100%' class='fasr_btn_more' :staticItems='[
            {
              "value": "ad4e65da-4883-4a18-a73d-c884c988e214",
              "label": "新增",
              "visible": true,
              "disabled": false,
              "type": "default",
              "ID": "ed4d27a4-2c70-22a6-1e3a-b8682d1d2702",
              "ValueInfo_label": "Schema.Page.PageGenRList.Controls.fasr_btn_more.staticItemsad4e65da_4883_4a18_a73d_c884c988e214.label",
              "icon": "fas dx-icon icon-t-plus"
            }
          ]' btnSpace='8px' :moreConf='true' :moreMaxCount='0' moreBtnIcon='fas dx-icon icon-t-plus' :btnDropPop='true'
            :noIconAnimation='true' @Click_新增='fasr_btn_more_Click_新增'
            @btnGroupItemClick='(action) => fasr_btn_more_btnGroupItemClick(action, row)'>
          </t-btn-group>
          <div ref='fasr_div_open'
            style='align-items:center;    display:none;    opacity:100%;    outline:0!important;    gap: 4px'
            class='fasr_div_open tr-div-default' :tabIndex='-1' @click='fasr_div_open_OnClick'>
            <t-label ref='fasr_labelopen' style='opacity:100%;    color:rgba(0,0,0,0.56);    font-weight:400'
              class='fasr_labelopen tr-lable-keyindicatorsname' valueType='static' :showHint='true' :constValue="'展开'">
            </t-label>
            <t-icon ref='fasr_iconopen' style='opacity:100%' class='fasr_iconopen tr-icon-default' size='10px'
              color='rgba(0,0,0,.56)' name='fas dx-icon icon-teld-arrow-bottom-thin' :visible='false'>
            </t-icon>
          </div>
        </div>
        <div ref='LayoutGridFilter'
          style='height:40px;    display:flex;    align-items:center;    opacity:100%;    justify-content:;'
          class='LayoutGridFilter row col-sm-12 col-xs-12' rowGap='' columnGap='' responsive='pc-mobile-gear'
          items='center'>
          <t-quick-filter ref='fasr_quick_filter' style='height:32px;    opacity:100%;    flex: 1'
            class='fasr_quick_filter' :optColumns='quick_filter_opts_columns'
            @filterChanged='fasr_quick_filter_OnFilterChanged' :pageID='PageID' :pageCode='PageCode'
            :quickItems='LocalVars.fasr_quick_filter_QuickItems'
            :quickItemSummary='LocalVars.fasr_quick_filter_QuickItemSummary' @init='fasr_quick_filter_Init'
            :filterFields='LocalVars.fasr_quick_filter_filterFields' @querySummary='fasr_quick_filter_QuerySummary'>
          </t-quick-filter>
        </div>

      </div>
      <t-repeat ref='fasr_repeat' style='margin-top:10px;    opacity:100%' class='fasr_repeat' pagingType='Scroll'
        :offset='300' :pullRefresh='true' :pageSize='20' :emptyText="'暂无数据'" height='' :showEmptyText='true'
        :resetScrollOnPageTurning='true' fillMode='fill' :showIndexAndCount='true' :isScrollOutside='false'
        pagerStyle='default' @scroll-load='fasr_repeat_getData' v-model:list='LocalVars.fasr_repeat_DataSource'
        :autoLoad='LocalVars.fasr_repeat_autoLoad'>
        <div v-for='(row, rowIndex) in LocalVars.fasr_repeat_DataSource' :data-row-index='rowIndex' class='infinitediv'>
          <div class='divlist tr-div-default' style='margin-bottom:10px;    opacity:100%'>
            <div class='divtitle tr-div-default'
              style='justify-content:space-between;    align-items:flex-start;    display:flex;    column-gap:12px;    opacity:100%'>
              <t-label class='fas_title tr-label-contenttitlen' style='display:inline;    opacity:100%'
                valueType='expression' :showHint='true' @click='fas_title_OnClick($event, row)' :labelValue="row.Name">
              </t-label>
              <t-icon class='fasr_copy' style='padding-left:8px;    opacity:100%;    	padding-bottom:2px' size='14px'
                color='rgba(0,0,0,0.56)' name='fas dx-icon icon-t-copy' @click='fasr_copy_OnClick($event, row)'>
              </t-icon>
              <t-btn-group class='fasr_btn_group' style='opacity:100%' :staticItems='btn_group_static_items_m'
                btnSpace='8px' :moreConf='true' :moreMaxCount='0' moreBtnIcon='fas dx-icon icon-t-more'
                :btnDropPop='true' :noIconAnimation='true' @Click_编辑='fasr_btn_group_Click_编辑($event, row)'
                @Click_查看='fasr_btn_group_Click_查看($event, row)' @Click_删除='fasr_btn_group_Click_删除($event, row)'
                @Click_评论='fasr_btn_group_Click_评论($event, row)'
                @btnGroupItemClick='(action) => fasr_btn_group_btnGroupItemClick(action, row)'>
              </t-btn-group>
            </div>
            <div class='divdate tr-div-default'
              style='justify-content:space-between;    display:flex;    align-items:center;    opacity:100%'>
              <div class='fasr_div_d10348 tr-div-default'
                style='min-width:65px;    height:24px;    justify-content:center;    display:flex;    align-items:center;    opacity:100%;    border-radius:12px;    outline:0!important'
                :class='fasr_div_d10348_classExpr(row)' :tabIndex='-1'>
                <t-label class='fasr_state' style='opacity:100%' valueType='expression' :showHint='true'
                  :labelValue="row.State || '--'">
                </t-label>
              </div>
              <t-label class='fasr_labelLastModifyTime tr-lable-normalindicatorsname'
                style='padding-left:8px;    opacity:100%;    font-family:AlibabaPuHuiTi;    font-size:12px'
                valueType='expression' :showHint='true'
                :labelValue="(!!row.LastModifierName ? Funcs.GetTerms('Schema.Common.LastModifier', '更新者') + ' ' + row.LastModifierName : '') + ' ' + (!!row.LastModifyTime ? Funcs.GetDateDiff(row.LastModifyTime) : '')">
              </t-label>
            </div>
            <div class='fasr_div7c046c tr-div-list'>
              <t-label class='fasr_label4ee525 tr-lable-normalindicatorsname' valueType='static' :showHint='true'
                constValue='单据编号'>
              </t-label>
              <t-label class='fasr_label5b27fd tr-lable-keyindicatorsnamen' valueType='expression' :showHint='true'
                :labelValue="row.Code || '--'">
              </t-label>
            </div>
            <div class='fasr_divd90cd1 tr-div-list'>
              <t-label class='fasr_label0cfb96 tr-lable-normalindicatorsname' valueType='static' :showHint='true'
                constValue='单据类型'>
              </t-label>
              <t-label class='fasr_labelaa90f2 tr-lable-keyindicatorsnamen' valueType='expression' :showHint='true'
                :labelValue="row.DocumentType || '--'">
              </t-label>
            </div>
            <div class='fasr_div79b2e1 tr-div-list'>
              <t-label class='fasr_label4676cc tr-lable-normalindicatorsname' valueType='static' :showHint='true'
                constValue='指派给'>
              </t-label>
              <t-label class='fasr_labela8ad2e tr-lable-keyindicatorsnamen' valueType='expression' :showHint='true'
                :labelValue="row.AssignTo || '--'">
              </t-label>
            </div>
            <div class='fasr_div0da812 tr-div-list'>
              <t-label class='fasr_labelf6d9e1 tr-lable-normalindicatorsname' valueType='static' :showHint='true'
                constValue='初始严重级别'>
              </t-label>
              <t-label class='fasr_label12b171 tr-lable-keyindicatorsnamen' valueType='expression' :showHint='true'
                :labelValue="row.InitSeverity || '--'">
              </t-label>
            </div>
            <div class='fasr_divf64a66 tr-div-list'>
              <t-label class='fasr_label49877f tr-lable-normalindicatorsname' valueType='static' :showHint='true'
                constValue='所属部门'>
              </t-label>
              <t-label class='fasr_label8861d1 tr-lable-keyindicatorsnamen' valueType='expression' :showHint='true'
                :labelValue="row.DutyDepartmentID || '--'">
              </t-label>
            </div>
            <div class='fasr_divf9c7eb tr-div-list'>
              <t-label class='fasr_label27b2ce tr-lable-normalindicatorsname' valueType='static' :showHint='true'
                constValue='所属团队'>
              </t-label>
              <t-label class='fasr_label0786d9 tr-lable-keyindicatorsnamen' valueType='expression' :showHint='true'
                :labelValue="row.DutyTeamID || '--'">
              </t-label>
            </div>
          </div>
        </div>
      </t-repeat>
    </div>
    <t-fab v-if='!screengreaterxs' ref='fasr_add' style='opacity:100%' class='fasr_add' :staticItems='[]'
      color='primary' direction='up' :fabDraggable='false' dragTop='90%' dragLeft='82%' @click='fasr_add_OnClick'
      @fabItemsClick='(action) => fasr_add_fabItemsClick(action)'>
    </t-fab>
  </div>
</template>

<script setup lang="ts">
import { ref, onBeforeMount, onMounted, computed, onUnmounted, reactive, nextTick, watch, provide, toRef } from 'vue'
import { mock } from './mock.js'
// 类型定义已通过全局声明自动加载

// 解构mock对象中的所有方法，保持原有名称
const {
  btn_group_static_items,
  filter_service,

  mixed_view_btn_group_static_items,
  
  mixed_view_opt_columns,
  popup_search_itemTemplateGeneral,
  quick_filter_opts_columns,
  btn_group_static_items_m,
  filter_fields,
  dataList
} = mock;

const Funcs = window.Funcs;

const screenWidth = ref(window.innerWidth);
const updateScreenWidth = () => {

};
const screengreaterxs = computed(() => screenWidth.value > 767);
// window.addTheme('GenerateCodeListTheme');
// 采用标准ref绑定，声明所需组件引用
const fasr_advfilter = ref<any>(null);
const fasr_btnGroup = ref<any>(null);
const fasr_mixed_view = ref<any>(null);
const commentdrawer = ref<any>(null);
const fasr_popup_search = ref<any>(null);
const fasr_quick_filter = ref<any>(null);
const fasr_repeat = ref<any>(null);
const fasr_btnQuery = ref<any>(null);
const PageCode = ref('Page_102718');
const PageID = ref('0cd099aa-976b-49e6-a298-295c4b66c67e');
const PageName = ref('界面102718');
// window.addPCStyle();

const LocalVars:any = reactive<any>({
  repeatDataTotal: 0,
  varCardPage: '',
  varInput: '',
  varSelectID: '',
  varViewCard: '',
  fasr_mixed_view_AdvQuery: null,
  fasr_filter_AdvQuery: null,
  fasr_filter_Fields: [],
  fasr_mixed_view_DataSource: [],
  fasr_mixed_view_PageIndex: 1,
  fasr_mixed_view_PageSize: 10,
  fasr_mixed_view_Total: 0,
  fasr_mixed_view_Loading: false,
  fasr_mixed_view_AllDataSource: [],
  fasr_mixed_view_AllLoading: false,
  fasr_popup_search_DataSource: [],
  fasr_popup_search_Total: 0,
  fasr_popup_search_PageIndex: 0,
  fasr_popup_search_loadingBase: false,
  fasr_popup_search_finishedBase: false,
  fasr_popup_search_refreshingBase: false,
  fasr_popup_search_AdvancedFilter: [],
  fasr_popup_search_Error: false,
  fasr_quick_filter_QuickItems: {},
  fasr_quick_filter_QuickItemSummary: [],
  fasr_quick_filter_filterFields: [{ "ID": "25501f1c-215c-4383-8ddd-b7a3cfa85e6e", "fieldCode": "State", "fieldName": "状态", "fieldAlias": "State", "displayType": "tab", "mockDataModel": "default", "isMultiple": false, "enableStatistics": true, "hideEmpty": false, "showTitle": true, "enableAllItem": false, "dataType": "SDO_BugState0714", "valueType": "sdo", "tableAlias": "DO_projectbug0714", "tableCode": "DO_projectbug0714", "tableName": "Bug", "filter_dataValue": "{\"DataBind\":\"DataQuery.GetSDO_BugState0714BasicList(DefaultInputFilter,PageIndex,PageSize,AdvancedFilter,AdvancedSort).List\",\"DataSource\":\"0ecf24c0-9097-4f8c-9771-685e6b833b95\",\"ActionType\":3,\"RelatedCdoCode\":\"GetSDO_BugState0714BasicList\",\"ServicePara\":[{\"ID\":\"faf25f6b-7bf2-45ed-a77f-5b7db5a1edf0\",\"Code\":\"DefaultInputFilter\",\"Name\":\"模糊匹配参数\",\"dataType\":\"String\",\"Value\":null},{\"ID\":\"c47664cf-d2e1-4408-a1a3-4612a94b8203\",\"Code\":\"PageIndex\",\"Name\":\"页码\",\"dataType\":\"Int\",\"Value\":null},{\"ID\":\"67b1818e-d677-4a6a-806f-8a6e383a2767\",\"Code\":\"PageSize\",\"Name\":\"分页大小\",\"dataType\":\"Int\",\"Value\":null},{\"ID\":\"9492fd56-8bd4-4d44-98cf-6818c6b0c0b2\",\"Code\":\"AdvancedFilter\",\"Name\":\"高级查询过滤条件\",\"dataType\":\"String\",\"Value\":null},{\"ID\":\"c82bd466-2a91-450f-ab8d-8f2737c48d0b\",\"Code\":\"AdvancedSort\",\"Name\":\"高级查询排序条件\",\"dataType\":\"String\",\"Value\":null}],\"ServiceParam\":[{\"ID\":\"faf25f6b-7bf2-45ed-a77f-5b7db5a1edf0\",\"Code\":\"DefaultInputFilter\",\"Name\":\"模糊匹配参数\",\"dataType\":\"String\",\"Value\":null},{\"ID\":\"c47664cf-d2e1-4408-a1a3-4612a94b8203\",\"Code\":\"PageIndex\",\"Name\":\"页码\",\"dataType\":\"Int\",\"Value\":null},{\"ID\":\"67b1818e-d677-4a6a-806f-8a6e383a2767\",\"Code\":\"PageSize\",\"Name\":\"分页大小\",\"dataType\":\"Int\",\"Value\":null},{\"ID\":\"9492fd56-8bd4-4d44-98cf-6818c6b0c0b2\",\"Code\":\"AdvancedFilter\",\"Name\":\"高级查询过滤条件\",\"dataType\":\"String\",\"Value\":null},{\"ID\":\"c82bd466-2a91-450f-ab8d-8f2737c48d0b\",\"Code\":\"AdvancedSort\",\"Name\":\"高级查询排序条件\",\"dataType\":\"String\",\"Value\":null}],\"isMultiple\":false,\"labelField\":\"Name\",\"valueField\":\"Code\",\"columns\":[{\"ID\":\"Code\",\"caption\":\"编号\",\"dataField\":\"Code\",\"dataType\":\"Int\"},{\"ID\":\"Name\",\"caption\":\"名称\",\"dataField\":\"Name\",\"dataType\":\"String\"}]}" }, { "ID": "3258a81c-3806-4f91-a875-d4958fa4684a", "fieldCode": "Severity", "fieldName": "严重级别", "fieldAlias": "Severity", "displayType": "tab", "mockDataModel": "default", "isMultiple": false, "enableStatistics": true, "hideEmpty": false, "showTitle": true, "enableAllItem": false, "dataType": "SDO_Severity0714", "valueType": "sdo", "tableAlias": "DO_projectbug0714", "tableCode": "DO_projectbug0714", "tableName": "Bug", "filter_dataValue": "{\"DataBind\":\"DataQuery.GetSDO_Severity0714BasicList(DefaultInputFilter,PageIndex,PageSize,AdvancedFilter,AdvancedSort).List\",\"DataSource\":\"ae001f92-3f0a-40c8-8d7d-b5aa80e13658\",\"ActionType\":3,\"RelatedCdoCode\":\"GetSDO_Severity0714BasicList\",\"ServicePara\":[{\"ID\":\"26a9bb8e-88fc-4e91-ab6d-0a786777f10e\",\"Code\":\"DefaultInputFilter\",\"Name\":\"模糊匹配参数\",\"dataType\":\"String\",\"Value\":null},{\"ID\":\"1f48812b-24f8-4265-b343-6c3170e08eeb\",\"Code\":\"PageIndex\",\"Name\":\"页码\",\"dataType\":\"Int\",\"Value\":null},{\"ID\":\"1407a646-25bf-4b9b-9cc1-5af0bde8f3a3\",\"Code\":\"PageSize\",\"Name\":\"分页大小\",\"dataType\":\"Int\",\"Value\":null},{\"ID\":\"abc808a3-9c08-4cf1-a855-d49c794a9220\",\"Code\":\"AdvancedFilter\",\"Name\":\"高级查询过滤条件\",\"dataType\":\"String\",\"Value\":null},{\"ID\":\"718692e3-1c6d-453f-a642-0e369cf04566\",\"Code\":\"AdvancedSort\",\"Name\":\"高级查询排序条件\",\"dataType\":\"String\",\"Value\":null}],\"ServiceParam\":[{\"ID\":\"26a9bb8e-88fc-4e91-ab6d-0a786777f10e\",\"Code\":\"DefaultInputFilter\",\"Name\":\"模糊匹配参数\",\"dataType\":\"String\",\"Value\":null},{\"ID\":\"1f48812b-24f8-4265-b343-6c3170e08eeb\",\"Code\":\"PageIndex\",\"Name\":\"页码\",\"dataType\":\"Int\",\"Value\":null},{\"ID\":\"1407a646-25bf-4b9b-9cc1-5af0bde8f3a3\",\"Code\":\"PageSize\",\"Name\":\"分页大小\",\"dataType\":\"Int\",\"Value\":null},{\"ID\":\"abc808a3-9c08-4cf1-a855-d49c794a9220\",\"Code\":\"AdvancedFilter\",\"Name\":\"高级查询过滤条件\",\"dataType\":\"String\",\"Value\":null},{\"ID\":\"718692e3-1c6d-453f-a642-0e369cf04566\",\"Code\":\"AdvancedSort\",\"Name\":\"高级查询排序条件\",\"dataType\":\"String\",\"Value\":null}],\"isMultiple\":false,\"labelField\":\"Name\",\"valueField\":\"Code\",\"columns\":[{\"ID\":\"Code\",\"caption\":\"编号\",\"dataField\":\"Code\",\"dataType\":\"Int\"},{\"ID\":\"Name\",\"caption\":\"名称\",\"dataField\":\"Name\",\"dataType\":\"String\"}]}" }, { "ID": "cc7c0556-313c-4ced-92fd-9af61d709cc7", "fieldCode": "ProblemCategory", "fieldName": "问题类别", "fieldAlias": "ProblemCategory", "displayType": "tab", "mockDataModel": "default", "isMultiple": false, "enableStatistics": true, "hideEmpty": false, "showTitle": true, "enableAllItem": false, "dataType": "SDO_BugCategory0714", "valueType": "sdo", "tableAlias": "DO_projectbug0714", "tableCode": "DO_projectbug0714", "tableName": "Bug", "filter_dataValue": "{\"DataBind\":\"DataQuery.GetSDO_BugCategory0714BasicList(DefaultInputFilter,PageIndex,PageSize,AdvancedFilter,AdvancedSort,DocumentType).List\",\"DataSource\":\"38ed3876-c693-44bc-a953-10332b51bba2\",\"ActionType\":3,\"RelatedCdoCode\":\"GetSDO_BugCategory0714BasicList\",\"ServicePara\":[{\"ID\":\"71651379-0a56-4366-ac4d-02480f330034\",\"Code\":\"DefaultInputFilter\",\"Name\":\"模糊匹配参数\",\"dataType\":\"String\",\"Value\":null},{\"ID\":\"36124a02-13e9-4648-85b8-ae6bcfece681\",\"Code\":\"PageIndex\",\"Name\":\"页码\",\"dataType\":\"Int\",\"Value\":null},{\"ID\":\"ff163706-300a-4f0d-9cea-57e9a7f0ea65\",\"Code\":\"PageSize\",\"Name\":\"分页大小\",\"dataType\":\"Int\",\"Value\":null},{\"ID\":\"842b0f8a-02a2-45fc-b3a3-fdb63ff008e7\",\"Code\":\"AdvancedFilter\",\"Name\":\"高级查询过滤条件\",\"dataType\":\"String\",\"Value\":null},{\"ID\":\"b3b28636-e37c-4a85-b2de-975de54b4a16\",\"Code\":\"AdvancedSort\",\"Name\":\"高级查询排序条件\",\"dataType\":\"String\",\"Value\":null},{\"ID\":\"39d2c2b6-dadd-44d3-b5bd-c21eef471ed5\",\"Code\":\"DocumentType\",\"Name\":\"单据类型\",\"dataType\":\"String\",\"Value\":\"\"}],\"ServiceParam\":[{\"ID\":\"71651379-0a56-4366-ac4d-02480f330034\",\"Code\":\"DefaultInputFilter\",\"Name\":\"模糊匹配参数\",\"dataType\":\"String\",\"Value\":null},{\"ID\":\"36124a02-13e9-4648-85b8-ae6bcfece681\",\"Code\":\"PageIndex\",\"Name\":\"页码\",\"dataType\":\"Int\",\"Value\":null},{\"ID\":\"ff163706-300a-4f0d-9cea-57e9a7f0ea65\",\"Code\":\"PageSize\",\"Name\":\"分页大小\",\"dataType\":\"Int\",\"Value\":null},{\"ID\":\"842b0f8a-02a2-45fc-b3a3-fdb63ff008e7\",\"Code\":\"AdvancedFilter\",\"Name\":\"高级查询过滤条件\",\"dataType\":\"String\",\"Value\":null},{\"ID\":\"b3b28636-e37c-4a85-b2de-975de54b4a16\",\"Code\":\"AdvancedSort\",\"Name\":\"高级查询排序条件\",\"dataType\":\"String\",\"Value\":null},{\"ID\":\"39d2c2b6-dadd-44d3-b5bd-c21eef471ed5\",\"Code\":\"DocumentType\",\"Name\":\"单据类型\",\"dataType\":\"String\",\"Value\":\"\"}],\"isMultiple\":false,\"labelField\":\"Name\",\"valueField\":\"Code\",\"columns\":[{\"ID\":\"Code\",\"caption\":\"编号\",\"dataField\":\"Code\",\"dataType\":\"Int\"},{\"ID\":\"Name\",\"caption\":\"名称\",\"dataField\":\"Name\",\"dataType\":\"String\"},{\"ID\":\"DocumentType\",\"caption\":\"单据类型\",\"dataField\":\"DocumentType\",\"dataType\":\"String\"}]}" }],
  fasr_advfilter_m_Fields: [],
  fasr_repeat_DataSource: [],
  fasr_repeat_AdvancedFilter: null,
  fasr_repeat_autoLoad: true,
});
class CtrlMethods {
  changeToSimpleMode() {
    //注释信息
    //顶部切换为缩略
    //查询方案
    let queryplan = document.querySelector('.LayoutGridQueryPlan') as HTMLElement | null;
    if (queryplan) {
      queryplan.style.paddingTop = '0'
      queryplan.style.paddingBottom = '0'
      queryplan.style.alignItems = 'center'
      queryplan.classList.remove('col-sm-12', 'col-xs-12')
      queryplan.classList.add('col-sm-6', 'col-xs-6')
      queryplan.querySelectorAll('.isNotChecked').forEach(item => item.style.display = 'none')
      let div = queryplan.querySelector('.fasr_advfilter_m > span > div') as HTMLElement | null;;
      if (div) {
        div.style.justifyContent = 'start'
        div.style.gap = '10px'
      }
    }
    //搜索
    let popupSearch = document.querySelector('.LayoutGridSearch') as HTMLElement | null;
    if (popupSearch) {
      popupSearch.style.opacity = '0'
      popupSearch.style.paddingTop = '0'
      popupSearch.style.justifyContent = 'end'
      popupSearch.style.gap = '10px'
      popupSearch.classList.remove('col-sm-12', 'col-xs-12')
      popupSearch.classList.add('col-sm-6', 'col-xs-6')
    }
    let filter = document.querySelector('.LayoutGridFilter') as HTMLElement | null;
    if (filter) { 
      filter.style.display = 'none';
    }
    let query = document.querySelector('.LayoutGridQuery') as HTMLElement | null;
    if (query) {
      query.style.flexDirection = 'row-reverse';
    }
    let divopen = document.querySelector('.fasr_div_open') as HTMLElement | null;
    if (divopen) {
      divopen.style.display = 'flex';
    }
    setTimeout(() => {
      let popupSearchContent = popupSearch?.querySelector('.t-popup-search') as HTMLElement | null;
      if (popupSearchContent) {
        popupSearchContent.classList.add('fasQuickFilter_Flex_0');
        popupSearchContent.style.display = 'flex'
        popupSearchContent.style.alignItems = 'center'
        let icon = popupSearchContent.querySelector('i') as HTMLElement | null; 
        if (icon) {
          let icon_left = icon.getBoundingClientRect().left
          if (queryplan && queryplan.querySelector('.icon-t-filter')) {
            let queryplan_icon_left = queryplan.querySelector('.icon-t-filter')?.getBoundingClientRect().left
            //查询方案图标14宽度+10 间隔
            icon.style.transform = `translateX(${queryplan_icon_left - icon_left + 24}px)`

          }
          icon.style.marginTop = '-1px'
        }
      }
        
    })
    if (fasr_popup_search.value) fasr_popup_search.value.showSearchBar = false
  }
  fasr_mixed_view_GridData_OnRowClick(e:any){
    console.log('fasr_mixed_view_cmdColClick',e)
  }
  backupToBasicMode() {
    //顶部切换为缩略
    //查询方案
    let queryplan = document.querySelector('.LayoutGridQueryPlan')  as HTMLElement | null;
    if (queryplan) {
      queryplan.style.paddingTop = '4px'
      queryplan.style.paddingBottom = '12px'
      queryplan.classList.remove('col-sm-6', 'col-xs-6')
      queryplan.classList.add('col-sm-12', 'col-xs-12')
      queryplan.querySelectorAll('.isNotChecked').forEach((item:any) => item.style.display = 'flex')
      let div = queryplan.querySelector('.fasr_advfilter_m > span > div') as HTMLElement | null;;
      if (div) {
        div.style.justifyContent = 'space-between'
      }
    }
    //搜索
    let popupSearch = document.querySelector('.LayoutGridSearch') as HTMLElement | null;
    if (popupSearch) {
      popupSearch.style.justifyContent = 'start'
      popupSearch.style.paddingTop = '4px'
      popupSearch.classList.remove('col-sm-6', 'col-xs-6')
      popupSearch.classList.add('col-sm-12', 'col-xs-12')
    }
    let filter = document.querySelector('.LayoutGridFilter') as HTMLElement | null;;
    if (filter) {
      filter.style.display = 'flex';
    }

    let query = document.querySelector('.LayoutGridQuery') as HTMLElement | null;;
    if (query) {
      query.style.flexDirection = 'row';
    }
    let divopen = document.querySelector('.fasr_div_open') as HTMLElement | null;;
    if (divopen) {
      divopen.style.display = 'none';
    }
    setTimeout(() => {
      if(popupSearch){
        let popupSearchContent = popupSearch.querySelector('.t-popup-search') as HTMLElement | null;;
        if (popupSearchContent) {
          popupSearchContent.classList.remove('fasQuickFilter_Flex_0');
          popupSearchContent.style.display = 'inline-block'
        }
      }
     
      // removed scheme dependency
    })

   
  }
}
const CtrlMethod = new CtrlMethods();

async function fasr_btnQuery_OnClick(e: any) {
  console.log('查询');
}

async function fas_btnReset_OnClick(e: any) {
  LocalVars.varInput = "";
  fasr_advfilter.value?.query(true);
}
async function fas_btnGroup_Click_新增(e: any) {
  window.location.href = '/ude/SAAS_EXT_Demo_CardPage_Simple'
}
async function fas_btnGroup_Click_查看(e: any) {
  if (!fasr_mixed_view.value?.gridInstance?.selectedRow) {
    let title = Funcs.GetTerms("Schema.Common.Prompt", "提示");
    let msg = Funcs.GetTerms("Schema.Common.ViewWarning", "请选择要查看的数据！");
    Funcs.Notify(title, msg, "error");
  } else {
    var dataid = fasr_mixed_view.value.gridInstance.selectedRow.ID;
    var ids = fasr_mixed_view.value.gridInstance.rows.map(t => t.ID);
    localStorage.Target = JSON.stringify(fasr_mixed_view.value.gridInstance.selectedRow)
    window.location.href = '/ude/SAAS_EXT_Demo_CardPage_Simple?isView=true'
    // Funcs.OpenFasPage(LocalVars.varViewCard, {
    //   InParam_FormState: 2,
    //   InParam_DataID: dataid,
    //   InParam_IDs: ids
    // },
    //   'inline',
    //   function () {
    //     fasr_advfilter.value?.query();
    //   });
  }
}
async function fas_btnGroup_Click_编辑(e) {
  if (!fasr_mixed_view.value?.gridInstance?.selectedRow) {
    let title = Funcs.GetTerms("Schema.Common.Prompt", "提示");
    let msg = Funcs.GetTerms("Schema.Common.EditWarning", "请选择要编辑的数据！");
    Funcs.Notify(title, msg, "error");
  } else {
    var dataid = fasr_mixed_view.value.gridInstance.selectedRow.ID;
    var ids = fasr_mixed_view.value.gridInstance.rows.map(t => t.ID);
 localStorage.Target = JSON.stringify(fasr_mixed_view.value.gridInstance.selectedRow)
    window.location.href = '/ude/SAAS_EXT_Demo_CardPage_Simple?isEdit=true'
    // Funcs.OpenFasPage(LocalVars.varCardPage, {
    //   InParam_FormState: 1,
    //   InParam_DataID: dataid,
    //   InParam_IDs: ids
    // },
    //   'inline',
    //   function () {
    //     fasr_advfilter.value?.query();
    //   });
  }
}
async function fas_btnGroup_Click_复制(e: any) {
  if (!fasr_mixed_view.value?.gridInstance?.selectedRow) {
    let title = Funcs.GetTerms("Schema.Common.Prompt", "提示");
    let msg = Funcs.GetTerms("Schema.Common.CopyWarning", "请选择要复制的数据！");
    Funcs.Notify(title, msg, "error");
  } else {
    alert('复制')
  }
}
async function fas_btnGroup_Click_删除(e: any) {
  if (!fasr_mixed_view.value?.gridInstance?.selectedRow) {
    let title = Funcs.GetTerms('Schema.Common.Prompt', '提示');
    let msg = Funcs.GetTerms('Schema.Common.DeleteWarning', '请选择要删除的数据！');
    Funcs.Notify(title, msg, 'error');
  } else {
    alert('删除')
  }
}
async function fasr_btn_group_Click_编辑(e: any, row: any) {
  let dataid = row.ID;
alert('编辑')
}
async function fas_btnGroup_Click_订阅数据(e: any) {
  fasr_advfilter.value?.openWarnSub()
}

async function fasr_copy_OnClick(e: any, row: any) {
  var input = document.createElement('input');
  input.setAttribute('value', row.Name);
  document.body.appendChild(input);
  input.select();
  var res = document.execCommand('copy');
  document.body.removeChild(input);
  let title = Funcs.GetTerms('Schema.Common.Prompt', '提示');
  let msg = Funcs.GetTerms('Schema.Common.CopySuccess', '复制成功');
  Funcs.Notify(title, msg, "success");
}



async function fasr_popup_search_OnClickItem(item: any, index: any) {
  var ids:Array<string> = new Array();
  Funcs.OpenFasPage(LocalVars.varCardPage, {
    InParam_FormState: 1,
    InParam_DataID: item.ID,
    InParam_IDs: ids
  },
    'inline',
    function () {

    });
}
async function fasr_add_OnClick(e: any) {
  Funcs.OpenFasPage(LocalVars.varCardPage, {
    InParam_FormState: 0,
    InParam_DataID: ''
  },
    'inline',
    function () {
      // removed scheme dependency
    });
}
async function fasr_btn_group_Click_查看(e: any, row: any) {
  let dataid = row.ID;
  var ids:Array<string> = [];
  Funcs.OpenFasPage(LocalVars.varViewCard, {
    InParam_FormState: 2,
    InParam_DataID: dataid,
    InParam_IDs: ids
  },
    'inline',
    function () {

    });
}
async function fasr_btn_group_Click_删除(e, row) {
  let deletedConfirm = Funcs.GetTerms('Schema.Common.Delete', '删除');
  let deleteConfirmInfo = Funcs.GetTerms('Schema.Common.DeleteConfirmInfo', '确定删除？');
  Funcs.Confirm(deletedConfirm, deleteConfirmInfo, function () {
  
    // removed scheme dependency
  }, function () {

  }, 'tr', { type: 'warning' })
}
async function fas_title_OnClick(e: any, row: any) {
  var dataid = row.ID;
  var ids:Array<string> = [];
  Funcs.OpenFasPage(LocalVars.varViewCard, {
    InParam_FormState: 1,
    InParam_DataID: dataid,
    InParam_IDs: ids
  },
    'inline',
    function (data: any) {

    });
}
async function fasr_btn_group_Click_评论(e, row) {
  LocalVars.varSelectID = row.ID;
  commentdrawer.value?.showDialog();
}
async function fas_txtInput_OnKeydown(e) {
  if (event && event.keyCode == 13) {
    setTimeout(function () {
      fasr_advfilter.value?.query();
    }, 10);
  }
}
async function commentcomponent_Event_CloseDrawer(e) {
  commentdrawer.value?.closeDialog();
}
async function fasr_quick_filter_OnFilterChanged(e) {
  fasr_repeat.value?.reload();
}
async function fasr_btn_more_Click_新增(e) {
  Funcs.OpenFasPage(LocalVars.varCardPage, {
    InParam_FormState: 0,
    InParam_DataID: ''
  },
    'inline',
    function () {
      // removed scheme dependency
    });
}
async function Page_OnLoaded(e: any) {

  document.querySelector(".fasr_repeat") && document.querySelector('.fasr_repeat').addEventListener('scroll', (e: any) => {
    if (e.target.scrollTop > 50 ) {
     
      CtrlMethod.changeToSimpleMode()
      setTimeout(() => {
        fasr_repeat.value && (fasr_repeat.value.fillMarginBottom = 1);
      })
    } else if (e.target.scrollTop <= 50 ) {
      fasr_repeat.value && (fasr_repeat.value.fillMarginBottom = 0);
      setTimeout(() => {
        CtrlMethod.backupToBasicMode()
      })
     
    }

  })
}
async function fasr_div_open_OnClick(e) {
  CtrlMethod.backupToBasicMode()
  window.flag_status_less_than = true
}
function fasr_advfiltermixViewRefreshByData(data) {
  // if (data) {
  LocalVars.fasr_mixed_view_DataSource = dataList;
  LocalVars.fasr_mixed_view_Total = dataList.length;
  // }
  // else LocalVars.fasr_mixed_view_Total = 0;

}
async function fas_btnGroup_btnGroupItemClick(action: any, row: any) {
  if (!action) return;
  let actions: Record<string, Function> = {
    'Click_新增': fas_btnGroup_Click_新增,
    'Click_查看': fas_btnGroup_Click_查看,
    'Click_编辑': fas_btnGroup_Click_编辑,
    'Click_复制': fas_btnGroup_Click_复制,
    'Click_删除': fas_btnGroup_Click_删除,
  }
  actions['Click_' + action.code] && actions['Click_' + action.code]()

}
let fasr_filter_filterFields = filter_fields;
LocalVars.fasr_filter_Fields = fasr_filter_filterFields

async function fasr_filter_Init() {
  LocalVars.fasr_filter_QuickItems = {};

}
async function fasr_mixed_view_Request(props: any) {

  LocalVars.fasr_mixed_view_Loading = true;
  LocalVars.fasr_mixed_view_DataSource = dataList;
  LocalVars.fasr_mixed_view_Total = dataList.length;
  LocalVars.fasr_mixed_view_PageIndex = 1;
  LocalVars.fasr_mixed_view_PageSize = 10;
  LocalVars.fasr_mixed_view_Loading = false;

}

async function fasr_mixed_view_columnLinkFormat(columnDataField: any) {

  alert('linkFormat')

}


async function fasr_popup_search_refresh(val: any) {
  LocalVars.fasr_popup_search_finishedBase = false;
  LocalVars.fasr_popup_search_loadingBase = true;
  LocalVars.fasr_popup_search_PageIndex = 1;
  LocalVars.fasr_popup_search_Error = false;
  fasr_popup_search_getData(val);

}
async function fasr_popup_search_clear() {
  LocalVars.fasr_popup_search_DataSource = [];
  LocalVars.fasr_popup_search_Total = 0;
  LocalVars.fasr_popup_search_Error = false;

}
function fasr_popup_search_AdvancedFilter() { return null; }
async function fasr_popup_search_getData(val: any) {
  LocalVars.fasr_popup_search_loadingBase = true;
  if (LocalVars.fasr_popup_search_refreshingBase) {
    LocalVars.fasr_popup_search_DataSource = [];
    LocalVars.fasr_popup_search_Total = 0;
    LocalVars.fasr_popup_search_refreshingBase = false;
  }

}
async function fasr_btn_more_btnGroupItemClick(action: any, row: any) {
  if (!action) return;
  let actions: Record<string, Function> = {
    'Click_新增': fasr_btn_more_Click_新增,
  }
  actions['Click_' + action.code] && actions['Click_' + action.code]()

}
async function fasr_quick_filter_Init() {
 

}
async function fasr_quick_filter_QuerySummary() {
 
}


LocalVars.fasr_repeat_autoLoad = false;

function fasr_repeat_AdvancedFilter() { return null; }
async function fasr_repeat_getData(index: number, size: number, done: any) {
 

}
async function fasr_btn_group_btnGroupItemClick(action: any, row: any) {
  if (!action) return;
  let actions: Record<string, Function> = {
    'Click_编辑': fasr_btn_group_Click_编辑,
    'Click_查看': fasr_btn_group_Click_查看,
    'Click_删除': fasr_btn_group_Click_删除,
    'Click_评论': fasr_btn_group_Click_评论,
  }
  actions['Click_' + action.code] && actions['Click_' + action.code](null, row)

}
function fasr_div_d10348_classExpr(row: any) {
  // 根据状态展示不同的背景色
  // let cls = {}
  // if (row.State == 0) {
  //     cls.clsBgRed = true
  // }
  // else if (row.State == 1) {
  //     cls.clsBgGreen = true
  // }
  // else if (row.State == 2) {
  //     cls.clsBgBlue = true
  // }
  // return cls
}
async function fasr_add_fabItemsClick(action: any, row: any) {
  if (!action) return;
  let actions: Record<string, Function> = {
    'OnClick': fasr_add_OnClick,
  }
  actions['Click_' + action.label] && actions['Click_' + action.label]()

}
async function fas_executeScript(scriptContent: string) {
  const response = await new Promise(resolve => {
    try {
      const func = new Function(scriptContent);
      const result = func(); resolve(result);
    } catch (e) {
      resolve(undefined);
    }
  })
  return response;

}
provide('executeScript', fas_executeScript);
window.LocalVars = LocalVars;
onBeforeMount(() => {
})
onMounted(async () => {
  LocalVars.fasr_mixed_view_AdvQuery = fasr_advfilter.value;
  LocalVars.fasr_filter_AdvQuery = fasr_advfilter.value;
  await nextTick();
  Page_OnLoaded();

  window.addEventListener('resize', updateScreenWidth);
  fasr_advfiltermixViewRefreshByData(fasr_advfilter.value);
})
onUnmounted(() => {
  window.removeEventListener('resize', updateScreenWidth);
})
</script>

<style>
.tr-pagesticky-bottom{
  padding-bottom: 20px !important;
}
.t-mixed-view.fasr_mixed_view{
  padding-top: 24px;
}
.col-auto.t-mixed-view_tabs,.t-import-export{
  display: none;
}
body{
  width: 100vw;
}
/* 抽离的样式 */
.divpc {
  opacity: 100%;
}

.fasr_div140102 {
  padding-top: 16px;
  padding-bottom: 0px;
  padding-left: 24px;
  padding-right: 24px;
  opacity: 100%;
}

.LayoutGrid140032 {
  display: flex;
  opacity: 100%;
}

.LayoutGrid140132 {
  display: flex;
  align-items: center;
  flex-direction: row;
  flex-wrap: nowrap;
  column-gap: 8px;
  opacity: 100%;
}

.fas_txtInput {
  width: 320px;
  opacity: 100%;
}

.fasr_btnQuery {
  opacity: 100%;
}

.fas_btnReset {
  opacity: 100%;
}

.LayoutGrid140134 {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  opacity: 100%;
}

.fas_btnGroup {
  width: 100%;
  justify-content: flex-end;
  opacity: 100%;
}

.div133915 {
  padding-top: 16px;
  padding-bottom: 24px;
  padding-left: 24px;
  padding-right: 24px;
  margin-bottom: 8px;
  opacity: 100%;
}

.div134112 {
  padding-left: 24px;
  padding-right: 24px;
  opacity: 100%;
}

.commentdrawer {
  opacity: 100%;
}

.commentdrawerdiv {
  width: 100%;
  opacity: 100%;
}

.commentcomponent {
  opacity: 100%;
}

@media screen and (max-width: 767px) {
  .divpc {}
}

@media screen and (min-width: 768px) {
  .divmobile {}
}

@media screen and (min-width: 768px) {
  .fasr_add {}
}

/* 移动端状态容器颜色，请在状态字段外容器编写类表达式 */
.clsBgRed {
  background: #FFEFF0;
}

.clsBgGreen {
  background: #EEF9EB;
}

.clsBgBlue {
  background: #E6F2FB;
}
</style>